import React from 'react'
import './examlistitem.less'
import CalendarTodayIcon from '@material-ui/icons/CalendarToday';
import Button from '@material-ui/core/Button'
import LinearProgress from '@material-ui/core/LinearProgress';

export default function ExamListItem(props) {
  return (
    <div className="exam-item">
      <CalendarTodayIcon />
      <section className="info">
        <h3>{props.data.title}</h3>
        <p>{props.data.itemCount}/{props.data.itemCount}题</p>
        <div>
          <LinearProgress variant="determinate" value={props.data.itemCount / 2 / props.data.itemCount * 100} />
        </div>
      </section>
      {/* <Button  onClick={()=>props.history.push({pathname:'/practice',state:{code:props.data.actionCode}})} variant="contained" color="primary" >练习</Button> */}
      <Button  onClick={()=>props.history.push(`/practice/${props.data.actionCode}`)} variant="contained" color="primary" >练习</Button>
    </div>
  )
}
